package com.ruix.app.model;

import org.json.JSONObject;

/**
 * Created by hadexs on 2017/5/12.
 */

public class PostAuther {

    private String name;
    private String avatar;
    private String company;
    private String position;
    private String locate;
    private int sex;

    public PostAuther parse(JSONObject object){
        if (object != null) {
            setName(object.optString("name",""));
            setAvatar(object.optString("avatar",""));
            setCompany(object.optString("company",""));
            setPosition(object.optString("position",""));
            setLocate(object.optString("locate",""));
            setSex(object.optInt("sex",0));
        }
        return this;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    public String getLocate() {
        return locate;
    }

    public void setLocate(String locate) {
        this.locate = locate;
    }

    public int getSex() {
        return sex;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }


    @Override
    public String toString() {
        return "PostAuther{" +
                "name='" + name + '\'' +
                ", avatar='" + avatar + '\'' +
                ", company='" + company + '\'' +
                ", position='" + position + '\'' +
                ", locate='" + locate + '\'' +
                ", sex=" + sex +
                '}';
    }
}
